// 用户登录
import {PageReq} from "@/api/common";

export interface PasswordLoginReq {
    username: string,
    password: string,
    captchaKey: string,
    captchaCode: string
}

export interface UserLoginResp {
    id: number,
    nickname: string,
    avatar: string
}

//用户注册
export interface PasswordRegisterReq {
    username: string,
    password: string
}

//明细信息
export interface UserDetailResp {
    id: number,
    nickname: string,
    avatar: string,
    signature: string,
    articleCount: number,
    articleCommentCount: number,
    articleStarCount: number,
    questionCount: number,
    questionAnswerCount: number,
    questionStarCount: number,
    followCount: number,
    followedCount: number,
    cover: string,
    hasFollow: boolean,
    allowBlog: boolean
}

//用户文章评论
export interface UserArticleCommentPageReq extends PageReq {
    userId: number,
}

export interface UserArticleCommentPageResp {
    id: number,
    articleId: number,
    articleTitle: string,
    commentTime: string,
    content: string
}

//用户收藏文章
export interface UserArticleStarPageReq extends PageReq {
    userId: number
}

//更新用户信息
export interface UserInfoUpdateReq {
    userId: number,
    nickname?: string,
    avatar?: string,
    cover?: string,
    signature?: string
}

//用户粉丝
export interface UserFollowPageReq extends PageReq {
    userId: number
}

export interface UserFollowedPageReq extends PageReq {
    userId: number
}

export interface UserFollowedPageResp {
    id: number,
    nickname: string,
    avatar: string,
    signature: string,
    articleCount: number,
    articleCommentCount: number,
    questionCount: number,
    questionAnswerCount: number,
    followedCount: number,
    hasFollow: boolean,
    following: boolean
}

//关注/取消关注
export interface UserFollowReq {
    userId: number,
    flag: boolean
}
//修改密码
export interface UserPwdUpdateReq {
    oldPwd: string,
    newPwd: string
}